package com.ae.counter;

import com.ae.Quackable;
import com.ae.observer.Observer;

public class QuackCounter implements Quackable {
	Quackable duck  ; 
	
	static int numberOfQuacks = 0 ; 
	
	public QuackCounter(Quackable duck) {
		this.duck = duck ; 
	}

	@Override
	public void quack() {
		duck.quack();
		numberOfQuacks ++ ; 

	}
	
	public static int getQuacks() {
		return QuackCounter.numberOfQuacks ; 
	}

	@Override
	public void registerObserver(Observer o) {
		duck.registerObserver(o);
		
	}

	@Override
	public void notifyObserver() {
		duck.notifyObserver();
		
	}

}
